﻿using System;
using System.Collections.Generic;
using System.Text;

namespace daSyntaxAnalyser.SyntaxTree
{
    using daBase.Objects;

    public class LabelDefinitionsElement : SyntaxTreeElement
    {
        private List<IdElement> ids;

        public List<IdElement> Ids { get { return ids; } set { ids = value; } }

        public LabelDefinitionsElement(TokenInfo StartInfo, List<IdElement> Ids, List<TokenInfo> Comments)
            : base(StartInfo, Comments)
        {
            ids = Ids;
        }

        public override string ToString()
        {
            return string.Format("label\r\n{0}", Tabulate(ids.Join("\r\n")));
        }

        protected override IEnumerator<ISyntaxTreeElement> CreateEnumerator()
        {
            foreach (IdElement id in ids)
                yield return id;
        }
    }
}
